package org.xgluo;

import com.sun.org.slf4j.internal.Logger;
import com.sun.org.slf4j.internal.LoggerFactory;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.xgluo.excle.ExcleUtil;


/**
 * @author LXG
 * @program: ExcleToXml
 * @name: ReadExcle
 * @description: 读取Excle文件
 * @date 2024年11月27日 10:28
 */
public class StartParseExcle {


    //创建一个日志器
    Logger logger = LoggerFactory.getLogger(this.getClass());

    //定义一个解析工具
    Workbook wb;

    /*
     * @Description: 使用Excle解析器，解析传入的表格文件获
     * @param url
     * @return void
     * @date 2024/11/28 10:23
     * @author LXG
     */
    public void parseExcle(String url) {

        
        wb = ExcleUtil.getWorkBookByType(url);
        int numberOfSheets = wb.getNumberOfSheets();
        int numberOfRow;
        short lastCellNum;
        Sheet sheet;
        Row row;
        Cell cell;
        for (int i = 0; i < numberOfSheets; i++) {
            sheet = wb.getSheetAt(i);
            numberOfRow = sheet.getLastRowNum();
            for (int j = 0; j < numberOfRow; j++) {
                row = sheet.getRow(j);
                lastCellNum = row.getLastCellNum();

            }
        }
    }





}
